/**
 * Created by LeungZ on 2016/8/17.
 */
class PodSrv {
    constructor(commonSrv) {
        "ngInject";
        this._commonSrv = commonSrv;
    }

    getListOfNode(para) {
        return this._commonSrv('get', '/ctg-imageconsole-web/pod/queryPodsByNode', {
            perpage: 10,
            page: para.page,
            nodeip: para.ip,
            clusterCode: para.code
        });
    }

    getListOfRC(para) {
        return this._commonSrv('get', '/ctg-imageconsole-web/pod/queryPodsByRc', {
            perpage: 10,
            page: para.page,
            namesp: para.namesp,
            name: para.name,
            clusterCode: para.code
        });
    }

    getDetail(para) {
        return this._commonSrv('get', '/ctg-imageconsole-web/pod/queryPodDetail', {
            name: para.name,
            namespace: para.namesp,
            clusterCode: para.code
        });
    }

    getLog(para){
        return this._commonSrv('get', '/ctg-imageconsole-web/log/queryContainerLog',{
            perpage: 200,
            page: para.page,
            namespace: para.namesp,
            podname: para.podName,
            containername: para.contName,
            clusterCode: para.code
        });
    }

    getResource(para){
        return this._commonSrv('post','/ctg-imageconsole-web/pod/queryPodResource', {
            clusterCode:para.code,
            isSingle:para.isSingle,
            names:para.names
        });
    }

    createConn(){
        return this._commonSrv('get','/ctg-imageconsole-web/ssh/createTerms');
    }

    closeConn(id){
        return this._commonSrv('get','/ctg-imageconsole-web/ssh/stopConnection',{
            instanceId:id
        });
    }
}
export default PodSrv